package com.whq.thrift.api.gateway.db;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import com.whq.common.StringUtil;

public class MerchantApiPermission implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private String merchantName;
	private String apiMethod;
	private String ipWhiteList;

	public Set<String> getIpWhiteSet() {
		Set<String> ret = StringUtil.split2set(ipWhiteList, ",");
		if (ret == null) {
			ret = new HashSet<String>(0);
		}
		return ret;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getMerchantName() {
		return merchantName;
	}

	public void setMerchantName(String merchantName) {
		this.merchantName = merchantName;
	}

	public String getApiMethod() {
		return apiMethod;
	}

	public void setApiMethod(String apiMethod) {
		this.apiMethod = apiMethod;
	}

	public String getIpWhiteList() {
		return ipWhiteList;
	}

	public void setIpWhiteList(String ipWhiteList) {
		this.ipWhiteList = ipWhiteList;
	}

	public String toString() {
		StringBuilder buf = new StringBuilder(30);
		buf.append("{");
		buf.append(merchantName);
		buf.append(",");
		buf.append(apiMethod);
		buf.append("}");
		return buf.toString();
	}

}
